<template>
  <div class="not-found-container">
    <img src="../assets/img/404.png" alt="Page Not Found" />
    <h1>404!</h1>
    <p>找不到您访问的页面，将会在 {{ counter }} 秒后为你跳转至主页...</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      counter: 3,
    };
  },
  mounted() {
    const interval = setInterval(() => {
      if (this.counter > 1) {
        this.counter--;
      } else {
        clearInterval(interval);
        this.$router.push("/");
      }
    }, 1000);
  },
};
</script>

<style scoped>
.not-found-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  background-color: #f0f0f0;
}

h1 {
  font-size: 4em;
  color: #0d0d0d;
}

p {
  margin-top: 20px;
  font-size: 1.2em;
  color: #666;
}

img {
  max-width: 250px;
  height: auto;
}
</style>
